# Makefile for the ROOT test programs.
# This Makefile shows nicely how to compile and link applications
# using the ROOT libraries on all supported platforms.
#
# Copyright (c) 2000 Rene Brun and Fons Rademakers
#
# Author: Fons Rademakers, 29/2/2000

#TESTAPP = testNewMinimizer
TESTAPP = CGE_center_regions_v08
#ROOTSYS = /home/administrator/root
include $(ROOTSYS)/test/Makefile.arch
#------------------------------------------------------------------------------

ifeq ($(PLATFORM),win32)
EXTRALIBS        = "$(ROOTSYS)/lib/libMinuit2.lib"
else
EXTRALIBS        = -lMinuit2 
CXXFLAGS += -g      
endif

USE_MPI = 1

# for using with MPI
ifneq ($(USE_MPI),)
CXX=mpic++
LD=mpic++
endif
ifneq ($(USE_OPENMP),)
CXXFLAGS += -D_GLIBCXX_PARALLEL -fopenmp 
LDFLAGS += -fopenmp 
endif

MINIMIZEOBJ      = $(TESTAPP).$(ObjSuf) CGEDefs.o
MINIMIZESRC      = $(TESTAPP).$(SrcSuf) CGEDefs.cpp
MINIMIZE         = $(TESTAPP)$(ExeSuf)

OBJS          = $(MINIMIZEOBJ)

PROGRAMS      = $(MINIMIZE)

.SUFFIXES: .$(SrcSuf) .$(ObjSuf) $(ExeSuf)


all:            $(PROGRAMS)

$(MINIMIZE): 	$(MINIMIZEOBJ)
		$(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@
		@echo "$@ done"

clean:
		@rm -f $(OBJS) core

distclean:      clean
		@rm -f $(PROGRAMS)  *Dict.* *.def *.exp \
		   *.root *.ps *.so *.lib *.dll *.d .def so_locations

.SUFFIXES: .$(SrcSuf)


.$(SrcSuf).$(ObjSuf):
	$(CXX) $(CXXFLAGS) -c $<
